package com.school.campus.service.impl;

import java.util.List;

import com.school.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.school.campus.mapper.SecondaryCollegeMapper;
import com.school.campus.domain.SecondaryCollege;
import com.school.campus.service.ISecondaryCollegeService;

/**
 * 二级学院信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-31
 */
@Service
public class SecondaryCollegeServiceImpl implements ISecondaryCollegeService {
    @Autowired
    private SecondaryCollegeMapper secondaryCollegeMapper;

    /**
     * 查询二级学院信息
     *
     * @param id 二级学院信息主键
     * @return 二级学院信息
     */
    @Override
    public SecondaryCollege selectSecondaryCollegeById(Long id) {
        return secondaryCollegeMapper.selectSecondaryCollegeById(id);
    }

    /**
     * 查询二级学院信息列表
     *
     * @param secondaryCollege 二级学院信息
     * @return 二级学院信息
     */
    @Override
    public List<SecondaryCollege> selectSecondaryCollegeList(SecondaryCollege secondaryCollege) {
        return secondaryCollegeMapper.selectSecondaryCollegeList(secondaryCollege);
    }

    /**
     * 新增二级学院信息
     *
     * @param secondaryCollege 二级学院信息
     * @return 结果
     */
    @Override
    public int insertSecondaryCollege(SecondaryCollege secondaryCollege) {
        secondaryCollege.setCreateDate(DateUtils.getNowDate());
        return secondaryCollegeMapper.insertSecondaryCollege(secondaryCollege);
    }

    /**
     * 修改二级学院信息
     *
     * @param secondaryCollege 二级学院信息
     * @return 结果
     */
    @Override
    public int updateSecondaryCollege(SecondaryCollege secondaryCollege) {
        return secondaryCollegeMapper.updateSecondaryCollege(secondaryCollege);
    }

    /**
     * 批量删除二级学院信息
     *
     * @param ids 需要删除的二级学院信息主键
     * @return 结果
     */
    @Override
    public int deleteSecondaryCollegeByIds(Long[] ids) {
        return secondaryCollegeMapper.deleteSecondaryCollegeByIds(ids);
    }

    /**
     * 删除二级学院信息信息
     *
     * @param id 二级学院信息主键
     * @return 结果
     */
    @Override
    public int deleteSecondaryCollegeById(Long id) {
        return secondaryCollegeMapper.deleteSecondaryCollegeById(id);
    }
}
